<!DOCTYPE html>
<html lang="en">
<head>
{{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
  .addsite button {
    margin-top: 30px;
    width: 80px;
    height: 35px;
    background-color: #e54242;
    border: none;
    border-radius: 5px;
    color: #fff;
}
</style>
<body class="common-home res layout-home1 setinfo">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
	{{template "pc/public/head.html" .}}
  {{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<p class="hd">个人资料</p>
        <form>
  				<div class="setInput">
  					<p>亲爱的 {{.info.monicker}} 用户，请您填写真实的资料信息</p>
  					<dl>
  						<dt>头像：</dt>
  						<dd>
  							<span class="upload" style="background-image: url({{.info.pathname}});">
  								<input type="file">
  							</span>
  						</dd>
  					</dl>
  					<dl>
  						<dt>用户名：</dt>
  						<dd><input type="text" name="monicker" value="{{.info.monicker}}" placeholder="请输入用户名"></dd>
  					</dl>
  					<dl>
  						<dt>姓名：</dt>
  						<dd><input type="text" name="name" value="{{.info.name}}" placeholder="请输入真实姓名"></dd>
  					</dl>
  					<dl>
  						<dt>性别：</dt>
  						<dd>
                <p><input type="radio" name="sex" value="0" {{if eq .info.sex "0"}}checked{{end}}>保密</p>
  							<p><input type="radio" name="sex" value="1" {{if eq .info.sex "1"}}checked{{end}}>男</p>
  							<p><input type="radio" name="sex" value="2" {{if eq .info.sex "2"}}checked{{end}}>女</p>
  						</dd>
  					</dl>
  					<p>联系方式</p>
  					<dl>
  						<dt>联系邮箱：</dt>
  						<dd><input type="text" name="mail" value="{{.info.mail}}" placeholder="请输入联系邮箱"></dd>
  					</dl>
  					<dl>
  						<dt>微信号：</dt>
  						<dd><input type="text" name="wechat" value="{{.info.wechat}}" placeholder="请输入微信号码"></dd>
  					</dl>
  				</div>
        </form>
        <div class="addsite">
          <button id="save">保存</button>
        </div> 
			</div>
		</div>
	</div>
</div>

<!-- Footer Container -->
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
</body>
</html>
<script type="text/javascript">
	$('#save').click(function(){
    var form=$('form').serialize()
    if(!$('input[name="monicker"]').val()){
      showToast("请输入用户名!");
      return false;
    }
    $.ajax({
      url:window.location.href,
      data:form,
      type:'post',
      success:function(res){
        if (res==1) {
          showToast("保存成功!");
          setTimeout(function(){history.go(0)}, 1000)
        }else{
          showToast("网络繁忙,请稍后再试!");
        }
      }
    })
  })
</script>
